<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.11"/>
<title>QJoysticks: VirtualJoystick Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { init_search(); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="icon.png"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">QJoysticks
   </div>
   <div id="projectbrief">A simple way to use joysticks with your Qt application</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.11 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="classes.html"><span>Class&#160;Index</span></a></li>
      <li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#pub-slots">Public Slots</a> &#124;
<a href="#signals">Signals</a> &#124;
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pro-methods">Protected Member Functions</a> &#124;
<a href="#pri-slots">Private Slots</a> &#124;
<a href="#pri-attribs">Private Attributes</a> &#124;
<a href="class_virtual_joystick-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">VirtualJoystick Class Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>Translates keyboard input to joystick input.  
 <a href="class_virtual_joystick.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="_virtual_joystick_8h_source.html">VirtualJoystick.h</a>&gt;</code></p>
<div class="dynheader">
Inheritance diagram for VirtualJoystick:</div>
<div class="dyncontent">
 <div class="center">
  <img src="class_virtual_joystick.png" usemap="#VirtualJoystick_map" alt=""/>
  <map id="VirtualJoystick_map" name="VirtualJoystick_map">
</map>
 </div></div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-slots"></a>
Public Slots</h2></td></tr>
<tr class="memitem:a746a7de4746074a076b00a61d7a08ea3"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_virtual_joystick.html#a746a7de4746074a076b00a61d7a08ea3">setJoystickID</a> (int id)</td></tr>
<tr class="separator:a746a7de4746074a076b00a61d7a08ea3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa19051519528f9723fcb4f3540c89099"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_virtual_joystick.html#aa19051519528f9723fcb4f3540c89099">setAxisRange</a> (qreal range)</td></tr>
<tr class="separator:aa19051519528f9723fcb4f3540c89099"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:abe2978ce90cbc91690dcfd86e0622417"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_virtual_joystick.html#abe2978ce90cbc91690dcfd86e0622417">setJoystickEnabled</a> (bool enabled)</td></tr>
<tr class="separator:abe2978ce90cbc91690dcfd86e0622417"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="signals"></a>
Signals</h2></td></tr>
<tr class="memitem:ad4a791f9830fe3122810827c7f2680f4"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ad4a791f9830fe3122810827c7f2680f4"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><b>enabledChanged</b> ()</td></tr>
<tr class="separator:ad4a791f9830fe3122810827c7f2680f4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:acba00e9d9278807a3e4651bae0b8da1e"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="acba00e9d9278807a3e4651bae0b8da1e"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><b>povEvent</b> (const <a class="el" href="struct_q_joystick_p_o_v_event.html">QJoystickPOVEvent</a> &amp;event)</td></tr>
<tr class="separator:acba00e9d9278807a3e4651bae0b8da1e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4cee5d33e25b400d05f73d4c084f923c"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a4cee5d33e25b400d05f73d4c084f923c"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><b>axisEvent</b> (const <a class="el" href="struct_q_joystick_axis_event.html">QJoystickAxisEvent</a> &amp;event)</td></tr>
<tr class="separator:a4cee5d33e25b400d05f73d4c084f923c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aad664b01b97e3dcbfcc565ad272284d6"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aad664b01b97e3dcbfcc565ad272284d6"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><b>buttonEvent</b> (const <a class="el" href="struct_q_joystick_button_event.html">QJoystickButtonEvent</a> &amp;event)</td></tr>
<tr class="separator:aad664b01b97e3dcbfcc565ad272284d6"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a3201442dbdaeac06c8180377309ed154"><td class="memItemLeft" align="right" valign="top">qreal&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_virtual_joystick.html#a3201442dbdaeac06c8180377309ed154">axisRange</a> () const </td></tr>
<tr class="separator:a3201442dbdaeac06c8180377309ed154"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4e1bff87282771b23b2f51aeab2f21a4"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_virtual_joystick.html#a4e1bff87282771b23b2f51aeab2f21a4">joystickEnabled</a> () const </td></tr>
<tr class="separator:a4e1bff87282771b23b2f51aeab2f21a4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a34a56116049438a5c1fbd3886726f037"><td class="memItemLeft" align="right" valign="top"><a class="el" href="struct_q_joystick_device.html">QJoystickDevice</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_virtual_joystick.html#a34a56116049438a5c1fbd3886726f037">joystick</a> ()</td></tr>
<tr class="separator:a34a56116049438a5c1fbd3886726f037"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pro-methods"></a>
Protected Member Functions</h2></td></tr>
<tr class="memitem:ad9d85107d01219889064422a784d5c6e"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_virtual_joystick.html#ad9d85107d01219889064422a784d5c6e">eventFilter</a> (QObject *object, QEvent *event)</td></tr>
<tr class="separator:ad9d85107d01219889064422a784d5c6e"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pri-slots"></a>
Private Slots</h2></td></tr>
<tr class="memitem:ac0ec476a1ace9195fffc0774bf332357"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_virtual_joystick.html#ac0ec476a1ace9195fffc0774bf332357">readAxes</a> (int key, bool pressed)</td></tr>
<tr class="separator:ac0ec476a1ace9195fffc0774bf332357"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a70c1bbf238b3141525595d527247d3d6"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_virtual_joystick.html#a70c1bbf238b3141525595d527247d3d6">readPOVs</a> (int key, bool pressed)</td></tr>
<tr class="separator:a70c1bbf238b3141525595d527247d3d6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac9d0aefa6e654d0a9e36bb913c83cac6"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_virtual_joystick.html#ac9d0aefa6e654d0a9e36bb913c83cac6">readButtons</a> (int key, bool pressed)</td></tr>
<tr class="separator:ac9d0aefa6e654d0a9e36bb913c83cac6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae2fb0a0aba3723c1345420edb15da47f"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_virtual_joystick.html#ae2fb0a0aba3723c1345420edb15da47f">processKeyEvent</a> (QKeyEvent *event, bool pressed)</td></tr>
<tr class="separator:ae2fb0a0aba3723c1345420edb15da47f"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pri-attribs"></a>
Private Attributes</h2></td></tr>
<tr class="memitem:a3f7f6e30dbdf50e94eccc44fe4250a09"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a3f7f6e30dbdf50e94eccc44fe4250a09"></a>
qreal&#160;</td><td class="memItemRight" valign="bottom"><b>m_axisRange</b></td></tr>
<tr class="separator:a3f7f6e30dbdf50e94eccc44fe4250a09"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3a99fdf6dc09d48fe57e98340139dac8"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a3a99fdf6dc09d48fe57e98340139dac8"></a>
bool&#160;</td><td class="memItemRight" valign="bottom"><b>m_joystickEnabled</b></td></tr>
<tr class="separator:a3a99fdf6dc09d48fe57e98340139dac8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8dde9f803affb3450c195f9a458bf640"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a8dde9f803affb3450c195f9a458bf640"></a>
<a class="el" href="struct_q_joystick_device.html">QJoystickDevice</a>&#160;</td><td class="memItemRight" valign="bottom"><b>m_joystick</b></td></tr>
<tr class="separator:a8dde9f803affb3450c195f9a458bf640"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Translates keyboard input to joystick input. </p>
<p>This class implements a virtual joystick device that uses the computer's keyboard as means to get the axis, button and POV values of the joystick. </p>
</div><h2 class="groupheader">Member Function Documentation</h2>
<a class="anchor" id="a3201442dbdaeac06c8180377309ed154"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">qreal VirtualJoystick::axisRange </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Returns the current axis range of the joystick. The axis range is an absolute value that represents the maximum value that the joystick can have.</p>
<p>For example, the <code>QJoystick</code> system supports an axis range of 1 (-1 to 1). If you set an axis range of 0.8 to the virtual joystick, then it will report values ranging from -0.8 to 0.8. </p>

<p>Referenced by <a class="el" href="class_virtual_joystick.html#ac0ec476a1ace9195fffc0774bf332357">readAxes()</a>.</p>

</div>
</div>
<a class="anchor" id="ad9d85107d01219889064422a784d5c6e"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">bool VirtualJoystick::eventFilter </td>
          <td>(</td>
          <td class="paramtype">QObject *&#160;</td>
          <td class="paramname"><em>object</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">QEvent *&#160;</td>
          <td class="paramname"><em>event</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>"Listens" for keyboard presses or releases while any window or widget of the application is focused.</p>
<dl class="section note"><dt>Note</dt><dd>This function may or may not detect keyboard events when the application is not focused. This depends on the operating system and the window manager that is being used. </dd></dl>

<p>References <a class="el" href="class_virtual_joystick.html#ae2fb0a0aba3723c1345420edb15da47f">processKeyEvent()</a>.</p>

</div>
</div>
<a class="anchor" id="a34a56116049438a5c1fbd3886726f037"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="struct_q_joystick_device.html">QJoystickDevice</a> * VirtualJoystick::joystick </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Returns a pointer to the virtual josytick device. This can be used if you need to customize the virtual joystick (e.g. add new axes or buttons). </p>

<p>Referenced by <a class="el" href="class_virtual_joystick.html#ac0ec476a1ace9195fffc0774bf332357">readAxes()</a>, <a class="el" href="class_virtual_joystick.html#ac9d0aefa6e654d0a9e36bb913c83cac6">readButtons()</a>, <a class="el" href="class_virtual_joystick.html#a70c1bbf238b3141525595d527247d3d6">readPOVs()</a>, and <a class="el" href="class_q_joysticks.html#ad46540bb96c23bef9dfc6284aee6e180">QJoysticks::updateInterfaces()</a>.</p>

</div>
</div>
<a class="anchor" id="a4e1bff87282771b23b2f51aeab2f21a4"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool VirtualJoystick::joystickEnabled </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Returns <code>true</code> if the virtual joystick is enabled. </p>

<p>Referenced by <a class="el" href="class_virtual_joystick.html#ae2fb0a0aba3723c1345420edb15da47f">processKeyEvent()</a>, <a class="el" href="class_virtual_joystick.html#ac0ec476a1ace9195fffc0774bf332357">readAxes()</a>, <a class="el" href="class_virtual_joystick.html#ac9d0aefa6e654d0a9e36bb913c83cac6">readButtons()</a>, and <a class="el" href="class_virtual_joystick.html#a70c1bbf238b3141525595d527247d3d6">readPOVs()</a>.</p>

</div>
</div>
<a class="anchor" id="ae2fb0a0aba3723c1345420edb15da47f"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void VirtualJoystick::processKeyEvent </td>
          <td>(</td>
          <td class="paramtype">QKeyEvent *&#160;</td>
          <td class="paramname"><em>event</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>pressed</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">private</span><span class="mlabel">slot</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Called when the event filter detects a keyboard event.</p>
<p>This function prompts the joystick to update its axis, button and POV values based on the keys that have been pressed or released. </p>

<p>References <a class="el" href="class_virtual_joystick.html#a4e1bff87282771b23b2f51aeab2f21a4">joystickEnabled()</a>, <a class="el" href="class_virtual_joystick.html#ac0ec476a1ace9195fffc0774bf332357">readAxes()</a>, <a class="el" href="class_virtual_joystick.html#ac9d0aefa6e654d0a9e36bb913c83cac6">readButtons()</a>, and <a class="el" href="class_virtual_joystick.html#a70c1bbf238b3141525595d527247d3d6">readPOVs()</a>.</p>

<p>Referenced by <a class="el" href="class_virtual_joystick.html#ad9d85107d01219889064422a784d5c6e">eventFilter()</a>.</p>

</div>
</div>
<a class="anchor" id="ac0ec476a1ace9195fffc0774bf332357"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void VirtualJoystick::readAxes </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>key</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>pressed</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">private</span><span class="mlabel">slot</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Polls the keyboard events and if required, reports a change in the axis values of the virtual joystick device. </p>

<p>References <a class="el" href="struct_q_joystick_axis_event.html#ab27e65287e8cd45c5d815a7601d038c5">QJoystickAxisEvent::axis</a>, <a class="el" href="class_virtual_joystick.html#a3201442dbdaeac06c8180377309ed154">axisRange()</a>, <a class="el" href="class_virtual_joystick.html#a34a56116049438a5c1fbd3886726f037">joystick()</a>, and <a class="el" href="class_virtual_joystick.html#a4e1bff87282771b23b2f51aeab2f21a4">joystickEnabled()</a>.</p>

<p>Referenced by <a class="el" href="class_virtual_joystick.html#ae2fb0a0aba3723c1345420edb15da47f">processKeyEvent()</a>.</p>

</div>
</div>
<a class="anchor" id="ac9d0aefa6e654d0a9e36bb913c83cac6"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void VirtualJoystick::readButtons </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>key</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>pressed</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">private</span><span class="mlabel">slot</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Polls the keyboard events and if required, reports a change in the button values of the virtual joystick device. </p>

<p>References <a class="el" href="struct_q_joystick_button_event.html#a0b53a31e37287a605b3d2caa1c7ecb29">QJoystickButtonEvent::button</a>, <a class="el" href="class_virtual_joystick.html#a34a56116049438a5c1fbd3886726f037">joystick()</a>, and <a class="el" href="class_virtual_joystick.html#a4e1bff87282771b23b2f51aeab2f21a4">joystickEnabled()</a>.</p>

<p>Referenced by <a class="el" href="class_virtual_joystick.html#ae2fb0a0aba3723c1345420edb15da47f">processKeyEvent()</a>.</p>

</div>
</div>
<a class="anchor" id="a70c1bbf238b3141525595d527247d3d6"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void VirtualJoystick::readPOVs </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>key</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>pressed</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">private</span><span class="mlabel">slot</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Polls the keyboard events and if required, reports a change in the POV/hat values of the virtual joystick device. </p>

<p>References <a class="el" href="class_virtual_joystick.html#a34a56116049438a5c1fbd3886726f037">joystick()</a>, <a class="el" href="class_virtual_joystick.html#a4e1bff87282771b23b2f51aeab2f21a4">joystickEnabled()</a>, and <a class="el" href="struct_q_joystick_p_o_v_event.html#a021def038c4be20e09b26a118e8c2464">QJoystickPOVEvent::pov</a>.</p>

<p>Referenced by <a class="el" href="class_virtual_joystick.html#ae2fb0a0aba3723c1345420edb15da47f">processKeyEvent()</a>.</p>

</div>
</div>
<a class="anchor" id="aa19051519528f9723fcb4f3540c89099"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void VirtualJoystick::setAxisRange </td>
          <td>(</td>
          <td class="paramtype">qreal&#160;</td>
          <td class="paramname"><em>range</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">slot</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Changes the axis range that the joystick can use. For example, if you set an axis range of 0.8, then axis values will be reported from -0.8 to 0.8.</p>
<p>If you set an axis range of 1 (maximum), then the joystick will report axis values ranging from -1 to 1. </p>

<p>Referenced by <a class="el" href="class_q_joysticks.html#a91abd059fcfbc3384a078bf730f477fe">QJoysticks::setVirtualJoystickRange()</a>.</p>

</div>
</div>
<a class="anchor" id="abe2978ce90cbc91690dcfd86e0622417"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void VirtualJoystick::setJoystickEnabled </td>
          <td>(</td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>enabled</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">slot</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Enables or disables the virtual joystick device. </p>

<p>Referenced by <a class="el" href="class_q_joysticks.html#a9aa53b1761048c15398be369cd229b7e">QJoysticks::setVirtualJoystickEnabled()</a>.</p>

</div>
</div>
<a class="anchor" id="a746a7de4746074a076b00a61d7a08ea3"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void VirtualJoystick::setJoystickID </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>id</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">slot</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Sets the ID of the virtual joystick device. The <code><a class="el" href="class_q_joysticks.html" title="Manages the input systems and communicates them with the application. ">QJoysticks</a></code> will automatically change the <em>ID</em> of the virtual joystick when it scans for new joysticks.</p>
<p>The virtual joystick will ALWAYS be the last joystick to be registered. </p>

<p>References <a class="el" href="struct_q_joystick_device.html#a77fdca9a6e30ef69eddbfb8e725d706a">QJoystickDevice::id</a>.</p>

<p>Referenced by <a class="el" href="class_q_joysticks.html#ad46540bb96c23bef9dfc6284aee6e180">QJoysticks::updateInterfaces()</a>.</p>

</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li><a class="el" href="_virtual_joystick_8h_source.html">VirtualJoystick.h</a></li>
<li>VirtualJoystick.cpp</li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.11
</small></address>
</body>
</html>
